package AdapterCar;

import ConcreteCar.Itasha.ItashaSound;
import ConcreteCar.Itasha.ItashaLamp;

import Controller.CarController;

public class ItashaCarAdapter extends CarController {
    private ItashaSound sound;  //定义适配者PoliceSound对象
    private ItashaLamp lamp;   //定义适配者PoliceLamp对象

    public ItashaCarAdapter() {
        sound = new ItashaSound();
        lamp = new ItashaLamp();
    }

    //发出痛车声音
    public void phonate() {
        sound.alarmSound();  //调用适配者类PoliceSound的方法
    }

    //呈现痛车光线
    public void twinkle() {
        lamp.alarmLamp();   //调用适配者类PoliceLamp的方法
    }
}
